From 519ee0665d4bd6aa374f4eaa5a311f461c1f7dc5 Mon Sep 17 00:00:00 2001 From: Mark Crichton Date: Thu, 6 Jan 2000 20:19:30 +0000 Subject: [PATCH] Fixed bug sent directly to me. Basically, we weren't checking a failure Fixed bug sent directly to me. Basically, we weren't checking a failure case from load_module, and returning junk to the application. Bad. See ChangeLog for more info. --- gdk-pixbuf/ChangeLog | 5 +++++ gdk-pixbuf/gdk-pixbuf-loader.c | 7 ++++--- gtk/gdk-pixbuf-loader.c | 7 ++++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index cbbaafc85b..8d6792224a 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,3 +1,8 @@ +2000-01-05 Mark Crichton + + * gdk-pixbuf/gdk-pixbuf-loader.c (gdk_pixbuf_loader_eat_header_write): + Return 0 if gdk_pixbuf_load_loader_module returns FALSE. + 2000-01-05 Elliot Lee * gdk-pixbuf/pixops/Makefile.am: Link with -lm (to get 'ceil' function) diff --git a/gdk-pixbuf/gdk-pixbuf-loader.c b/gdk-pixbuf/gdk-pixbuf-loader.c index cd1b91418b..69bb7f98ea 100644 --- a/gdk-pixbuf/gdk-pixbuf-loader.c +++ b/gdk-pixbuf/gdk-pixbuf-loader.c @@ -300,9 +300,10 @@ gdk_pixbuf_loader_eat_header_write (GdkPixbufLoader *loader, const guchar *buf, priv->header_buf_offset += nbytes; - if(priv->header_buf_offset >= LOADER_HEADER_SIZE) - gdk_pixbuf_loader_load_module(loader); - + if(priv->header_buf_offset >= LOADER_HEADER_SIZE) { + if (gdk_pixbuf_loader_load_module(loader) == 0) + return 0; + } return nbytes; } diff --git a/gtk/gdk-pixbuf-loader.c b/gtk/gdk-pixbuf-loader.c index cd1b91418b..69bb7f98ea 100644 --- a/gtk/gdk-pixbuf-loader.c +++ b/gtk/gdk-pixbuf-loader.c @@ -300,9 +300,10 @@ gdk_pixbuf_loader_eat_header_write (GdkPixbufLoader *loader, const guchar *buf, priv->header_buf_offset += nbytes; - if(priv->header_buf_offset >= LOADER_HEADER_SIZE) - gdk_pixbuf_loader_load_module(loader); - + if(priv->header_buf_offset >= LOADER_HEADER_SIZE) { + if (gdk_pixbuf_loader_load_module(loader) == 0) + return 0; + } return nbytes; } -- 2.30.2